<?php defined('KX_ROOT') || exit('Permission denied');?><!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
    <title>数据统计 - 原创专区 - <?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "sitename");?></title>
    <link rel="stylesheet" href="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/css/style.css"/>
    <link rel="shortcut icon" type="image/ico" href="/favicon.ico"/>
    <meta name="author" content="www.ptcms.com">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width"/>
    <meta name="applicable-device" content="pc">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <meta http-equiv="Cache-Control" content="no-transform"/>
    <link rel="canonical" href="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "pcurl");?><?php echo $_SERVER['REQUEST_URI'];?>"/>
    <style>

    </style>
</head>
<body>
<div class="header">
    <div>
        <a href="/">
            <div class="logo"><span>原创专区</span></div>
        </a>
    </div>
</div>
<div class="body">
    <div class="left bg-white">
    <style>
        .icon {
            width: 20px;
            height: 20px;
            display: inline-block;
            vertical-align: middle;
            margin-right: 10px;
        }

        .icon-home {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-home.png");
        }

        li.active .icon-home {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-home-active.png");
        }

        .icon-novel {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-novel.png");
        }

        li.active .icon-novel {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-novel-active.png");
        }

        .icon-stat {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-stat.png");
        }

        li.active .icon-stat {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-stat-active.png");
        }

        .icon-money {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-money.png");
        }

        li.active .icon-money {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-money-active.png");
        }

        .icon-userinfo {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-userinfo.png");
        }

        li.active .icon-userinfo {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-userinfo-active.png");
        }
        .add_novel:before{
            content: '+';
            width: 20px;
            height: 20px;
            display: inline-block;
            left: 60px;
            position: relative;
            margin-left: -20px;
            font-weight: 700;
        }
        .add_novel a{
            color: #929292 !important;
        }
    </style>
    <ul class="nav">
        <li class="<?php echo $pagesign == 'home'?'active':'';?>">
            <a href="<?php echo \Kuxin\Helper\Url::build("author.author.index",[],"");?>">
                <i class="icon icon-home"></i>专区首页
            </a>
        </li>
        <li class="<?php echo in_array($pagesign, ['novel','chapter'])?'active':'';?>">
            <?php if(in_array($pagesign, ['novel','chapter'])):?>
            <a href="javascript:void(0);">
                <i class="icon icon-novel"></i>作品管理
            </a>
            <ul class="sub-nav">
                <?php if(is_array($novels)): foreach($novels as $key =>$loop):?>
                <li class="<?php echo $_GET['novelid']==$loop['id']?'active':'';?>" style="width: 165px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
                    <a href="<?php echo \Kuxin\Helper\Url::build("author.chapter.index",['novelid'=>$loop['id']],"");?>" title="<?php echo $loop['name'];?>"><?php echo $loop['name'];?></a>
                </li>
                <?php endforeach; endif;?>
                <li class="add_novel"><a href="<?php echo \Kuxin\Helper\Url::build("author.novel.add",[],"");?>">创建作品</a></li>
            </ul>
            <?php else:?>
            <a href="<?php echo \Kuxin\Helper\Url::build("author.novel.index",[],"");?>">
                <i class="icon icon-novel"></i>作品管理
            </a>
            <?php endif;?>
        </li>
        <li class="<?php echo $pagesign == 'stat'?'active':'';?>">
            <a href="<?php echo \Kuxin\Helper\Url::build("author.stat.index",[],"");?>">
                <i class="icon icon-stat"></i>数据统计
            </a>
        </li>
        <li class="<?php echo in_array($pagesign, ['incomeindex','incomerecord','incomemanage','incomeguarantee'])?'active':'';?>">
            <?php if(in_array($pagesign, ['incomeindex','incomerecord','incomemanage','incomeguarantee'])):?>
            <a href="javascript:void(0);">
                <i class="icon icon-money"></i>稿酬收入
            </a>
            <ul class="sub-nav">
                <li class="<?php echo $pagesign=='incomerecord'?'active':'';?>"><a href="<?php echo \Kuxin\Helper\Url::build("author.income.record",[],"");?>">收入明细</a></li>
                <li class="<?php echo in_array($pagesign, ['incomemanage','incomeguarantee'])?'active':'';?>"><a href="<?php echo \Kuxin\Helper\Url::build("author.income.manage",[],"");?>">提现管理</a></li>
            </ul>
            <?php else:?>
            <a href="<?php echo \Kuxin\Helper\Url::build("author.income.record",[],"");?>">
                <i class="icon icon-money"></i>稿酬收入
            </a>
            <?php endif;?>
        </li>
        <li class="<?php echo $pagesign == 'authorinfo'?'active':'';?>">
            <a href="<?php echo \Kuxin\Helper\Url::build("author.author.info",[],"");?>">
                <i class="icon icon-userinfo"></i>作家资料
            </a>
        </li>
    </ul>
</div>
    <div class="right bg-white h100">
        <div class="mlr20 mt30">
            <span class="color0 size16">选择作品</span>
            <select class="ml10 novel ptb5 pl10 pr40 border-c-e9  vertical-middle">
                <?php if(is_array($novels)): foreach($novels as $key =>$loop):?>
                <option value="<?php echo $loop['id'];?>"><?php echo $loop['name'];?></option>
                <?php endforeach; endif;?>
            </select>
            <button class="ml10 plr30 ptb5 bg-red color1 view">查看</button>
        </div>
        <ul class="stat border stat_total mlr20 mt30" >
            <li class="inline-block border-r" style="width: 25%;">
                <span class="ml30 color0 block mt20 size16 bold">总点击</span>
                <p class="ml30 color2 size24 mt10 mb20"><span class="num">0</span> <span class="color92 size14">次</span></p>
            </li>
            <li class="inline-block border-r" style="width: 25%;">
                <span class="ml30 color0 block mt20 size16 bold">总收藏</span>
                <p class="ml30 color2 size24 mt10 mb20"><span class="num">0</span> <span class="color92 size14">人</span></p>
            </li>
            <li class="inline-block border-r" style="width: 24%;">
                <span class="ml30 color0 block mt20 size16 bold">总推荐</span>
                <p class="ml30 color2 size24 mt10 mb20"><span class="num">0</span> <span class="color92 size14">票</span></p>
            </li>
            <li class="inline-block" style="width: 24%;">
                <span class="ml30 color0 block mt20 size16 bold">总订阅</span>
                <p class="ml30 color2 size24 mt10 mb20"><span class="num">0</span> <span class="color92 size14">次</span></p>
            </li>
        </ul>
        <style>
            table.stat th,
            table.stat td{
                text-align: center;
                line-height: 66px;
                border: 1px solid #E9E9E9;
            }
            table.stat th{
                color: #323237;
                background-color: #f5f5f5;
                font-weight: 700;
            }
            table.stat td{
                color: #626267;
            }
        </style>
        <table class="mlr20 mt30 stat" style="width: 950px;">
            <thead>
            <tr>
                <th>时间</th>
                <th>点击</th>
                <th>收藏</th>
                <th>推荐</th>
                <th>订阅</th>
            </tr>
            </thead>
            <tbody>
            <tr class="stat_day">
                <td>今日</td>
                <td>0</td>
                <td>0</td>
                <td>0</td>
                <td>0</td>
            </tr>
            <tr class="stat_week">
                <td>本周</td>
                <td>0</td>
                <td>0</td>
                <td>0</td>
                <td>0</td>
            </tr>
            <tr class="stat_month">
                <td>本月</td>
                <td>0</td>
                <td>0</td>
                <td>0</td>
                <td>0</td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
<div class="footer text-center">
    <?php $list=\Kuxin\Block::show('page.list', []);?>
    <span class="aboutlink">
        <?php if(is_array($list)): foreach($list as $key =>$loop):?>
        <a href="<?php echo \Kuxin\Helper\Url::build("page.detail",['pageid'=>$loop['id'],'key'=>$loop['key']],"");?>" title="<?php echo $loop['name'];?>"> <?php echo $loop['name'];?> </a>
        <?php endforeach; endif;?>
    </span>
    <span class="inline-block ml40">Copyright © 2009 - 2019 <a href="<?php echo $pt['config']['siteurl'];?>" target="_blank"><?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "sitename");?></a>. All Rights Reserved . 版权所有<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "sitename");?></span>
</div>
<script src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/js/jquery-3.3.1.js"></script>
<script src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/js/layer/layer.js"></script>
<script src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/js/common.js"></script>
<?php 
    $novelsJson = json_encode(
        array_combine(
            array_column($novels, 'id'),
            array_map(function($novel){
                return array_filter($novel, function ($key) {
                    return in_array($key, [
                        'id',
                        'num_words',
                        'num_allvisit',
                        'num_monthvisit',
                        'num_weekvisit',
                        'num_dayvisit',
                        'num_vote',
                        'num_monthvote',
                        'num_weekvote',
                        'num_dayvote',
                        'num_mark',
                        'num_monthmark',
                        'num_weekmark',
                        'num_daymark',
                        ]);
                    }, ARRAY_FILTER_USE_KEY);
            },$novels)
        )
    );
;?>
<script>

    var novels = <?php echo $novelsjson;?>,
        total = $('ul.stat_total'),
        day = $('tr.stat_day'),
        week = $('tr.stat_week'),
        month = $('tr.stat_month');
    $('button.view').click(function () {
        var novel = novels[$('select.novel').val()];
        total.find('li:eq(0) .num').html(novel.num_allvisit);
        total.find('li:eq(1) .num').html(novel.num_mark);
        total.find('li:eq(2) .num').html(novel.num_vote);
        day.find('td:eq(1)').html(novel.num_dayvisit);
        day.find('td:eq(2)').html(novel.num_daymark);
        day.find('td:eq(3)').html(novel.num_dayvote);
        week.find('td:eq(1)').html(novel.num_weekvisit);
        week.find('td:eq(2)').html(novel.num_weekmark);
        week.find('td:eq(3)').html(novel.num_weekvote);
        month.find('td:eq(1)').html(novel.num_monthvisit);
        month.find('td:eq(2)').html(novel.num_monthmark);
        month.find('td:eq(3)').html(novel.num_monthvote);
    }).click();
</script>
</body>
</html>